<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作品列表</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script type="text/javascript">

	/**************  查询  *******************/
	function search(){
		var actionUrl = "${ctx}/painting/listPainting.do?pageSize=16";

		$("#curPage").val(1);
		$("#searchForm").attr("action",actionUrl);
		$("#searchForm").submit();
	}
	

	/******改变作品上传状态 *****/
	function changeState(id,status){
		if(status == '2'){
			if (window.confirm("确认删除此作品？")) {
				$.ajax( {
					type : "POST",
					url : "${ctx}/painting/changeUploadState.do?painting.id="+id+"&operateStr="+status,
					timeout : 6000,
					async : false, //ajax同步
					success : function(data, textStatus) {
						if(data == '0000'){
							window.location.reload(true);
						}else{
							alert(data);
						}
					}
				});
			}
		}else{
			$.ajax( {
				type : "POST",
				url : "${ctx}/painting/changeUploadState.do?painting.id="+id+"&operateStr="+status,
				timeout : 6000,
				async : false, //ajax同步
				success : function(data, textStatus) {
					if(data == '0000'){
						window.location.reload(true);
					}
				}
			});
		}
	}
	

	/******  预览   ****/
	function preview(id){
		var curPage = $("#curPage").val();
		var actionUrl = "${ctx}/painting/showDetail.do?painting.id="+id+"&curPage="+curPage;
		window.location.href = actionUrl ;
	}

	$(function(){
		$("a[name='modifyHref']").click(function(){
			var id = $(this).attr("title");
			art.dialog.open('${ctx}/painting/modifyPrepare.do?painting.id='+id,{title:'修改作品',width:820,height:550,lock:true},false);
	    });

	    $("#addPaintingImage").click(function(){
			art.dialog.open('${ctx}/painting/addPrepare.do',{title:'发布作品',width:820,lock:true},false);
	    });

		m2('m1_005','m1_005_01');
	});

</script>
</head>

<body>

<!-- 页面头部  -->
<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx}/painting/listPainting.do?pageSize=16" id="searchForm" name="searchForm" method="post">
<table width="960" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #ccc;margin: 0 auto" align="center" bgcolor="#ffffff">
                <tr>
                  <td width="35"></td>
                  <td class="bt14A"><img src="../images/an12.gif" width="106" height="31" id="addPaintingImage" style="cursor: pointer;"></td>
                  <td class="bt14A">&nbsp;</td>
                  <td colspan="3" class="bt14A" align="left">作品名称
                     <input name="filterTxt" value="title" type="hidden"/>
					 <input name="filterValue" type="text" size="15" value="${filterValue }"/>
                     <img src="../images/an25.gif" width="50" height="21" onclick="search()" style="cursor: pointer;vertical-align: middle;" >
                   </td>
                  <td class="bt14A">&nbsp;</td>
                  <td class="bt14A"><div align="right" style="font-family: 宋体;font-size: 12px;"><jsp:include page="/commons/paging_footer.jsp"/></div></td>
                  <td width="35"></td>
                </tr>
               <tr><td colspan="100%" align="left">
						<table cellpadding="0" cellspacing="0" border="0">
							 <c:forEach items="${page.result}" var="result" varStatus="status">
					              <%@ include file="/member/painting_detail_fragment.jsp" %>
							</c:forEach>
						</table>
				</td></tr>
                <tr>
                  <td>&nbsp;</td>
                  <td colspan="3"></td>
                  <td>&nbsp;</td>
                  <td colspan="3" class="bt14A"><div align="right" style="font-size: 12px;"><jsp:include page="/commons/paging_footer.jsp"/></div></td>
                  <td>&nbsp;</td>
                </tr>
</table>
          
</form>
    
<jsp:include page="/commons/foot_member.jsp"></jsp:include>

</body>
</html>